
function sqlLogCtrl($scope){
    $scope.querySqlLogList = function(){
        sqlLogQuery($scope,'');
    }

    $scope.queryOperatorLogList = function(){
        operaotrLogQuery($scope,'');
    }
}

function operaotrLogQuery($scope,pageNo){
    if (!pageNo || pageNo == 0) {
        pageNo = 1;
    }

    var paramObj = new Object();
    paramObj.pageNo = pageNo;

    $.ajax({
        url: '/log/doReadOperatorLogList',
        data: paramObj,
        success: function (data) {
            var responseObj = $.parseJSON(data);
            if (responseObj.success) {
                $scope.$apply(function () {
                    $scope.dataList_operator_log = responseObj.dataList;
                });
            } else {
                alert(responseObj.errorMsg);
            }
        },
        error: function (error) {
            console.log(error);
        }
    });
}

function sqlLogQuery($scope, pageNo) {
    if (!pageNo || pageNo == 0) {
        pageNo = 1;
    }

    var paramObj = new Object();
    paramObj.pageNo = pageNo;

    $.ajax({
        url: '/log/doReadSqlLogList',
        data: paramObj,
        success: function (data) {
            var responseObj = $.parseJSON(data);
            if (responseObj.success) {
                $scope.$apply(function () {
                    $scope.dataList = responseObj.dataList;
                });
            } else {
                alert(responseObj.errorMsg);
            }
        },
        error: function (error) {
            console.log(error);
        }
    });
}

angular
    .module('inspinia')
    .controller('sqlLogCtrl',sqlLogCtrl)